<div class="mainpage">
    <div class="shout-box" style="display: none;"></div>
    <div class="pull-right">
    	<a href="/admin/article/create" class="btn btn-primary">Add New</a>
    </div>
    <div class="clear"></div>
    <?php echo $this->grid->getView()->getHtml(); ?>
</div>
<div id="modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
</div>
<script type="text/javascript">
<!--
$(function(){
	$('.enquire-update-modal').live('click', function(){
		$.ajax('/admin/enquire/update/', {
            data: 'id='+$(this).attr('data-enquire-id'),
            type: 'post',
            success: function(d) {
                $('#modal').html(d);
            },
            error:function(e){console.log(e); alert('Error during load ajax!');}
           });
	});

	$('#submit').live('click', function(){
		$.ajax('/admin/enquire/update/t/save/', {
            data: $('#modal-form').serialize(),
            type: 'post',
            success: function(d) {
                alert(d);
                $('form').submit();
            },
            error:function(e){console.log(e); alert('Update enquire error!');}
           });
	});
});
//-->
</script>